package priv.lhy.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: lihy
 * date: 2019/11/18 15:09
 * description:
 */
@RestController
public class OrderController {

    @GetMapping("/r/r1")
    @PreAuthorize("hasAnyAuthority('p1')")
    public String r1(){
        return "r1";
    }

    @RequestMapping("/r/r2")
    @PreAuthorize("hasAnyAuthority('p1')")
    public String r2(){
        return "r2";
    }

    @RequestMapping("/p/p1")
    @PreAuthorize("hasAnyAuthority('p21')")
    public String p1(){
        return "p1";
    }

    @RequestMapping("/s/s1")
    public String s1(){
        return "s1";
    }
}
